/*
 * Created on Oct 31, 2004
 *
 * @author ctaylor
 * 
 */
package com.lite.ui;

import java.util.ArrayList;
import java.util.List;

import javax.swing.table.AbstractTableModel;

/**
 * @author ctaylor
 *
 */
public class HistoryTableModel extends AbstractTableModel
{
    /**
     * 
     */
    private static final long serialVersionUID = 7819323023821508187L;
    private List<String> statmentHistory = new ArrayList<String>();

    /* (non-Javadoc)
     * @see javax.swing.table.TableModel#getColumnCount()
     */
    public int getColumnCount()
    {
        return 1;
    }

    /* (non-Javadoc)
     * @see javax.swing.table.TableModel#getRowCount()
     */
    public int getRowCount()
    {
        if(statmentHistory != null)
        {
            return statmentHistory.size();
        }
        return 0;
    }

    /* (non-Javadoc)
     * @see javax.swing.table.TableModel#getValueAt(int, int)
     */
    public Object getValueAt(int row, int column)
    {
        return statmentHistory.get(row);
    }
    public String getColumnName(int arg0)
    {
        return "SQL Statement";
    }
    /**
     * @param statmentHistory The statmentHistory to set.
     */
    public void setStatmentHistory(List<String> statmentHistory)
    {
        this.statmentHistory = statmentHistory;
    }
}
